<style src="./award.css" scoped ></style>
<template>
  <vue-tab current="award"></vue-tab>
  <div class="sec-top">
    <div class="form-inline">
      <select class="form-control" v-model="status">
        <option value="" selected>全部</option>
        <option value="1" >待审核</option>
        <option value="2" >已发奖</option>
        <option value="3">不发奖</option>
      </select>
      <label>手机号:</label>
      <input type="number" class="form-control input-sm" placeholder="输入手机号搜索"  v-model="phone">
      <button class="btn btn-primary btn-sm" @click="getList">搜索</button>
      <button class="btn btn-sm btn-primary" @click="exportData()">导出</button>
    </div>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <!-- <div class="fl-right">
      <button v-show="phone && showExport" class="btn btn-sm btn-primary" @click="exportDate()">导出</button>
    </div> -->
  </div>
  <table class="table table-bordered table-hover">
    <caption>用户列表</caption>
    <thead>
      <tr>
        <th class="col-sm-1">流水号</th>
        <th class="col-sm-2">时间</th>
        <th class="col-sm-1">收款人手机</th>
        <th class="col-sm-2">收款人email</th>
        <th class="col-sm-1">收款人姓名</th>
        <th class="col-sm-1">付款金额/元</th>
        <th class="col-sm-1">付款理由</th>
        <th class="col-sm-2">状态</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="(index, item) in list">
        <td>{{index + 1}}</td>
        <td>{{item.time}}</td>
        <td>{{item.phone}}</td>
        <td>{{item.email}}</td>
        <td>{{item.name}}</td>
        <td>{{item.price}}</td>
        <td>{{item.reasonDesc}}</td>
        <td>
          <button v-if="+item.status === 1" class="btn btn-sm btn-primary" @click="update(item.id, 2)">发奖</button>
          <button v-if="+item.status === 1" class="btn btn-sm btn-primary" @click="update(item.id, 3)">不发奖</button>
          <span v-if="+item.status === 2" >已发</span>
          <span v-if="+item.status === 3">不发奖</span>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>

<script type="text/javascript" src="./award.js"></script>
